<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="layui/css/layui.css">
    <link rel="stylesheet" href="admin/login.css">
    <link rel="icon" href="/vote/admin/t_logo.ico" type="img/x-ico" />
    <title>管理后台</title>
</head>
<body class="login-wrap">
    <div class="login-container">
        <form class="login-form">
            <div class="input-group">
                <input type="text" id="username" class="input-field">
                <label for="username" class="input-label">
                    <span class="label-title">管理员账号</span>
                </label>
            </div>
            <div class="input-group">
                <input type="password" id="password" class="input-field">
                <label for="password" class="input-label">
                    <span class="label-title">密码</span>
                </label>
            </div>
            <button type="button" class="login-button">登录<i class="ai ai-enter"></i></button>
        </form>
    </div>
</body>
<script src="layui/layui.js"></script>
<script src="admin/index.js" data-main="login"></script>
<script type="text/javascript">
layui.use(['jquery','layer'],function($,layer) {
	$("button").click(function () {
		$.post("/vote/user/adminlogin", {
			"account": $("#username").val(),
			"password": $("#password").val()	
			},function(data){
		          if(data==1){
		        	  location.href = "admin/index.html";  
		          }else{
		        	  layer.msg("账户或密码错误");
		          }
		          }, "json");
	});
});
</script>
</html>